const fs = require('fs')
const path = require('path')



function getFileByPath(fpath, succCb, errCb) {
    fs.readFile(path.join(fpath), 'utf-8', (err, dataStr) => {
        if (err) return errCb(err)
        succCb(dataStr)
    })
}

getFileByPath(path.join(__dirname, './files/1.txt'), data => {
    console.log(data);
    getFileByPath(path.join(__dirname, './files/2.txt'), data => {
        console.log(data);
        getFileByPath(path.join(__dirname, './files/3.txt'), data => {
            console.log(data);

        });

    });

});


